﻿using Power.Models;
using Power.View;
using Power.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Power.Common
{
    public static class StaticCache
    {
        #region 地图
        //地图页面全局只加载一次，静态缓存
        public static Map Map;

        /// <summary>
        /// 全透明显示地图
        /// </summary>
        /// <param name="map"></param>
        /// <param name="isShow">是否显示(不显示时，背景全透明非销毁)</param>
        public static void MapHiddenShow(this Map map,bool isShow = false) {
            //标记是否第一次加载
            bool emptyFlag = false;
            if (map == null)
            {
                emptyFlag = true;
                map = new Map();
                Map = map;
            }
            map.WindowState = WindowState.Maximized;
            if (isShow)
            {
                if (!emptyFlag) { 
                    (map.DataContext as MapViewModel).InitData();
                }
                map.Opacity = 1;
                map.ShowInTaskbar = true;
            }
            else {
                map.Opacity = 0;
                map.ShowInTaskbar = false;
            }
            if (emptyFlag) {
                map.Show();
            }
        }

        #endregion

        #region ai复核
        public static Dictionary<string,List<DataList>> AiDic;

        public static List<WorkSpaceEntity> ExcelList;

        public static Dictionary<string, List<PicturesInfo>> AiDicPic;
        #endregion
    }
}
